<!DOCTYPE html>
<html lang="en"><head>
    <meta charset="utf-8">
    <title>登录页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Le styles -->
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css">

    <!--[if lte IE 6]>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-ie6.css">
    <![endif]-->
    <!--[if lte IE 7]>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/ie.css">
    <![endif]-->
    
    <style type="text/css">
      * html {
        background-color: #f5f5f5;
      }
      body {
        height: 100%;
        padding-top: 40px;
        padding-bottom: 40px;
        background-color: #f5f5f5;
      }
      #wrap {
        min-height: 100%;
        height: auto !important;
        height: 100%;
        /* Negative indent footer by it's height */
        margin: 0 auto -60px;
      }

      .form-signin {
        max-width: 300px;
        _width:300px;
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }
      .form-signin input[type="text"],
      .form-signin input[type="password"] {
        font-size: 16px;
        height: auto;
        margin-bottom: 15px;
        padding: 7px 9px;
      }
      #push,
      #footer {
        height: 60px;
      }
      #footer {
        background-color: #f5f5f5;
      }

      /* Lastly, apply responsive CSS fixes as necessary */
      @media (max-width: 767px) {
        #footer {
          margin-left: -20px;
          margin-right: -20px;
          padding-left: 20px;
          padding-right: 20px;
        }
      }
      .container {
        width: auto;
        max-width: 680px;
        _width:680px;
        /*_width:expression(this.clientWidth > 680 ? "680px" : "auto");*/
      }
      .container .credit {
        margin: 20px 0;
      }
    </style>

    

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.min.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
  </head>

<body>

    
    <div id="footer">
      <div class="container">
          <form class="bs-docs-example form-horizontal" onsubmit='return false;' style="display:none">
				<div class="control-group">
				<label class="control-label" for="inputEmail">用户名</label>
				<div class="controls">
					<input type="text" class="input-large"  id="inputEmail" placeholder="">
					</div>
				</div>	  
          <div class="control-group">
              <label class="control-label" for="inputPassword">密码</label>
              <div class="controls">
                <input type="password" id="inputPassword" placeholder="">
              </div>
            </div>
			<div class="control-group">
					<div class="controls">
					  <button  class="btn" id="btnlogin">登录</button>
					</div>
				  </div>
		</form>
      </div>
    </div>
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->

    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
    <!--[if lte IE 7]>
	<script type="text/javascript" src="js/bootstrap-ie.js"></script>
	<script type="text/javascript" src="js/json2.js"></script>
    <![endif]-->
	<script type="text/javascript">
	$(function(){
		window.login = function(uname,password){			
			$.ajax({
			type: "POST",
			url: "https://polyfinancefill.yunxiaoxin.net/auth/user/password",
			contentType: "application/json; charset=utf-8",
			dataType : "json",
			data: JSON.stringify({
				mobile : uname, password : password
			}),
			success: function (result) {
				//alert(JSON.stringify(result));
				if (result.status == 'no_user'){
					alert('输入有误，查无此人');
					return ;
				}else{
					window.external.setToken_Userinfo(result.userinfo.mobile|| result.userinfo.nickname, result.userinfo.headimg,result.token,result.expireTime, result.userinfo.Corp.corp_name);
					window.location = './main.html?access_token='+ result.token +'&corpname=' + result.userinfo.Corp.corp_name ;
				}
			}
		});
		}		
		
	})
    </script>

</body></html>
